<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/header.jsp"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
<script src="js/jquery-3.5.1.js" type="text/javascript"></script>
<style>
    .bbtt {
        margin-left: 87px;
        margin-top: 10px;
    }
</style>
<script>

</script>
<!-- 班级管理页面开始 -->
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <h2>
                班级管理<i class="fa fa-user"></i> ${loginName }
            </h2>
            <!--  -->
            <div class="x_content">
                <br />
                <form id="query" data-parsley-validate
                      class="form-horizontal form-label-left" method="post"
                      action="${ctx}/classServlet.do">
                    <input type="hidden" name="param" value="cha"/>
                    <input type="hidden" name="pageIndex" value="1"/>
                    <ul style="list-style: none;">
                        <li><label class="control-label col-md-3 col-sm-3 col-xs-12"
                                   for=>专业类型 </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="major" value="" id="major"
                                        class="form-control col-md-7 col-xs-12">
                                    <option value="">---请选择---</option>
                                    <c:forEach var="major" items="${MajorAll}">
                                        <option value="${major.major}"${param.major eq major.major?'selected':''}>
                                            ${major.major}
                                        </option>
                                    </c:forEach>

                                </select>
                            </div>
                        </li>

                        <br />
                        <li>
                            <div class="form-group">
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <button type="submit" class="btn btn-primary bbtt"
                                            class="btn btn-success ">查&nbsp;&nbsp;&nbsp;&nbsp;询</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>

            </div>
            <!--   -->
        </div>
    </div>
    <!-- 表格 -->
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <a href="jsp/classadd.jsp" class="btn btn-success btn-sm">添加班级信息</a>

            <c:if test="${! empty classInfoList}">
                <table id="datatable" class="table table-striped table-bordered">
                    <tr>
                        <th>班级编号</th>
                        <th>班级名称</th>
                        <th>专业类型</th>
                        <th style="width: 125px;">操作</th>
                    </tr>
                    <c:forEach var="classInfo" items="${ classInfoList }">
                        <tr>
                            <td>${ classInfo.classId }</td>
                            <td>${ classInfo.className }</td>
                            <td>${ classInfo.major }</td>

                            <td>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-danger">点击操作</button>
                                    <button type="button" class="btn btn-danger dropdown-toggle"
                                            data-toggle="dropdown" aria-expanded="false">
                                        <span class="caret"></span> <span class="sr-only">Toggle
											Dropdown</span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu" >
                                        <li><a
                                                href="classServlet.do?param=modify_cha&&classId=${classInfo.classId}"
                                                data-toggle="tooltip" data-placement="top"
                                                data-original-title="修改班级信息">修改</a></li>
                                        <li><a   href="classServlet.do?param=delete&&classId=${classInfo.classId}"
                                               data-toggle="tooltip" data-placement="top"
                                               data-original-title="删除班级信息"  onclick="return deleteAct('${classInfo.classId}');" >删除</a>
                                        </li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="10" style="text-align: right;"><span>共有${pages.totalCount }条数据，${pages.currentPageNo }/${pages.totalPageCount }页</span>
                            <a href="javascript:page_nav(document.forms[0],1);">首页</a>&nbsp;
                            <a href="javascript:page_nav(document.forms[0],${pages.currentPageNo}-1);">上一页</a>&nbsp;
                            <a href="javascript:page_nav(document.forms[0],${pages.currentPageNo}+1);">下一页</a>&nbsp;
                            <a href="javascript:page_nav(document.forms[0],${pages.totalPageCount});">末页</a>&nbsp;
                        </td>
                    </tr>
                </table>
            </c:if>
        </div>
    </div>


    <c:if test="${ empty classInfoList }">
        <h1>没有学生信息</h1>
    </c:if>
    <!-- 表格 -->
    <!-- 分页 -->

    </div>
    <!-- 分页 -->
</div>

<!-- appInfoList页面结束 -->
<!-- /page content -->
<%@ include file="../common/footer.jsp"%>
<script src="${ctx}/statics/localjs/classguanli.js"></script>
<script src="${ctx}/statics/localjs/rollpage.js"></script>

